<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type = "text/javascript">

        function page(rs) {

            var pageNumber = rs.pageNumber

            var pageSize = rs.pageSize

            var total = rs.total

            var pages = rs.pages


            $("#pid").val(pageNumber);

            $("#aid").val(pages);
        }

        function toPage(i) {

            var a = parseInt($("#pid").val());

            var b = parseInt($("#aid").val());

            if(i == 1) {

                if(a > 1) {

                    $("#pid").val(a - 1);
                }else {

                    alert("现在已经是首页!!!");
                }
            }else if(i == 2) {

                if(a < b) {

                    $("#pid").val(a + 1);
                }else {

                    alert("现在已经是尾页!!!");
                }
            }else if(i == 3) {

                $("#pid").val(1);
            }else if(i == 4) {

                $("#pid").val(b);
            }

            loadPage();
        }

    </script>
</head>
<body>
<a href = "javaScript:toPage(1)">上一页</a>
<a href = "javaScript:toPage(2)">下一页</a>
<a href = "javaScript:toPage(3)">首页</a>
<a href = "javaScript:toPage(4)">尾页</a>
第<input type = "text" name = "pageNumber" id = "pid" size="1">页
共<input type = "text" name = "allPage" id = "aid" size="1">页
</body>
</html>